<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>This 的指向问题</title>
</head>

<body>

  <script>
    var number = 5;
    var obj = {
      number: 2,
      fn1: (function () {
        var number;
        this.number *= 2;
        number = number * 2;
        number = 4;
        return function () {
          var num = this.number;
          console.log(num);
          
          this.number *= 2;  
          number *= 3;
          console.log(number);
        }
      })()
    }
    var fn1 = obj.fn1;
    fn1.call(null);
    obj.fn1();
    console.log(window.number);//10,12,2,36,20
  </script>

</body>

</html>